package com.example.base.net

import com.example.base.entity.AgreeEntity
import com.example.base.entity.CommentEntity
import com.example.base.entity.CommentEntityItem
import com.example.base.entity.Reply
import com.example.base.entity.Res
import com.example.base.entity.TypeEntity
import com.example.base.entity.VideoEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.HTTP
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Query

interface VideoApiService {
    @GET("/videotype/getSimpleType")
    fun videoType():Flow<Res<TypeEntity>>
    @GET("/videosimple/getSimpleVideoByChannelId")
    fun video(@Query("channelId")channelId:String,@Query("page")page:Int,@Query("pagesize")pagesize:Int):Flow<Res<VideoEntity>>
    @PUT("/agree/agree")
    fun agree(@Body body: RequestBody):Flow<Res<AgreeEntity>>
    @HTTP(method = "DELETE", path = "/agree/unagree", hasBody = true)
    fun unagree(@Body body: RequestBody):Flow<Res<Boolean>>
    @GET("/comment/getCommentByUserId")
    fun getComment(@Query("datatype")datatype:Int,@Query("itemid")itemid:String):Flow<Res<CommentEntity>>
    @POST("/comment/publishComment")
    fun sendComment(@Body body: RequestBody):Flow<Res<CommentEntityItem>>
    @POST("/reply/reply")
    fun sendChildComment(@Body body: RequestBody):Flow<Res<Reply>>
}